package top.jojoace.RequestParam_DTO_Validate.dto;

import lombok.Builder;
import lombok.Getter;
import lombok.NonNull;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.Max;

@ToString
@Builder
@Getter
public class ValidationDTO {
    @Length(min = 2,max = 10,message = "长度不在范围")
    private String name;

    @Range(max = 10,min = 1)
    private Integer id;

    /**
     * 标记扫描该字段内的校验注解
     */
    @Valid
    private inDTO in;
}

@Getter
class inDTO{
    @Max(10)
    private Integer id;
}
